<!--
 * @FilePath     : /study_code/css/margin1-1.html
 * @Description  : 解决 margin 叠加
 * @Date         : 2025-04-27 10:49:35
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-27 10:50:47
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <style>
      .box1,
      .box2 {
        width: 80px;
        height: 30px;
      }

      .box1 {
        margin-bottom: 60px;
        background-color: lightblue;
      }

      .box2 {
        /* margin-top: 20px; */
        background-color: lightcoral;
      }

      /*
      解决：将间距都加在 上容器的 bottom；
      或者下容器的 top 上；（可能会出现 margin 传递现象）
      */
    </style>
  </head>

  <body>
    <div class="box1"></div>
    <div class="box2"></div>

    <hr />
  </body>
</html>
